/**
 * 
 */
	
$(function(){
	var tid=$("#tid").val();
	$("#goumaibt").click(function(){
		alert("xxx")
		var pid=$("#goumaibt").val();
		alert(tid);
		alert(pid);
		$.ajax({
			type:"post",
			url:"../caidan",
			data:{"tid":tid,"pid":pid},
			dataType:"json",
			
			success:function(data){
				
				var str="";
				$.each(data,function(i,item){
					
					str +="<h2 align='center'>菜名:"+item.pname+"</h2>";
					str +="<h3 align='center'>价格:"+item.pprice +"元</h3>";
			
				});
				alert(str);
				$("#dingdang").html(str);
			
			}
			
		});
		
	});
	
	$("#goumaibt1").click(function(){
		alert("xxx")
		var pid=$("#goumaibt1").val();
		alert(tid);
		alert(pid);
		$.ajax({
			type:"post",
			url:"../caidan",
			data:{"tid":tid,"pid":pid},
			dataType:"json",
			
			success:function(data){
				
				var str="";
				$.each(data,function(i,item){
					
					str +="<h2 align='center'>菜名:"+item.pname+"</h2>";
					str +="<h3 align='center'>价格:"+item.pprice +"元</h3>";
			
				});
				alert(str);
				$("#dingdang").html(str);
			
			}
		});
		
	});

	
	$("#goumaibt2").click(function(){
		alert("xxx")
		var pid=$("#goumaibt2").val();
		alert(tid);
		alert(pid);
		$.ajax({
			type:"post",
			url:"../caidan",
			data:{"tid":tid,"pid":pid},
			dataType:"json",
			
			success:function(data){
				
				var str="";
				$.each(data,function(i,item){
					
					str +="<h2 align='center'>菜名:"+item.pname+"</h2>";
					str +="<h3 align='center'>价格:"+item.pprice +"元</h3>";
			
				});
				alert(str);
				$("#dingdang").html(str);
			
			}
		});
		
	});
	
	$("#goumaibt3").click(function(){
		alert("xxx")
		var pid=$("#goumaibt3").val();
		alert(tid);
		alert(pid);
		$.ajax({
			type:"post",
			url:"../caidan",
			data:{"tid":tid,"pid":pid},
			dataType:"json",
			
			success:function(data){
				
				var str="";
				$.each(data,function(i,item){
					
					str +="<h2 align='center'>菜名:"+item.pname+"</h2>";
					str +="<h3 align='center'>价格:"+item.pprice +"元</h3>";
			
				});
				alert(str);
				$("#dingdang").html(str);
			
			}
		});
		
	});
	
})